﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Home_Edit_And_Delete : System.Web.UI.Page
{
    string _connectionstring = "Server=NontananYe.mssql.somee.com;Uid=NontananYe_SQLLogin_1;PASSWORD=mkjsaf29n8;database=NontananYe;Max Pool Size=400;Connect Timeout=600;";
    protected void Page_Load(object sender, EventArgs e)
    {
        Gridloadmashow();
    }
    private void Gridloadmashow()
    {
        try
        {

            string _sql = "SELECT Cus_ID, Cus_FirstName, Cus_LastName, Cus_NickName FROM NontananYe_SQLLogin_1.Customer";
            SqlConnection _connection = new SqlConnection(_connectionstring);
            SqlCommand _command = new SqlCommand(_sql, _connection);
            SqlDataAdapter _adapter = new SqlDataAdapter(_command);
            DataTable _table = new DataTable();
            _adapter.Fill(_table);

           
    GridView1.DataSource = _table;
            GridView1.DataBind();

        }
        catch
        {
            throw;
        }
    }
}
